Use liblcf string and array types#2280
Conversation
|
|
||
| if (it == cache.end()) { | ||
| const std::string path = FileFinder::FindImage(folder_name, filename); | ||
| // FIXME: STRING_VIEW string copies here |
There was a problem hiding this comment.
Yeah, I didn't fully StringView'ify filefinder.
There was a problem hiding this comment.
I would prefer it when you don't touch the FileFinder too much otherwise my next big FS PR will be terrible to rebase.
| return fmt::basic_string_view<C>(s.data(), s.size()); | ||
| } | ||
| } } | ||
|
|
There was a problem hiding this comment.
Highlighting these ugly hacks to get fmtlib working without needing to include <fmt/format.h> everywhere
There was a problem hiding this comment.
any hack that doesn't increase buildtime by 100% because of libfmt is good.
src/string_view.h
Outdated
| namespace lcf { | ||
| // FIXME: This is hacky, but unfortunately nowhere else convenient to put this to be able to print DBString ... | ||
| inline fmt::basic_string_view<char> to_string_view(const lcf::DBString& s) { | ||
| return to_string_view(StringView(s)); |
There was a problem hiding this comment.
And this one, which is worse because we shouldn't even be including DBString here, but nowhere else to put this..
723ce46 to
3c3ceac
Compare
Ghabry
left a comment
There was a problem hiding this comment.
Some more numbers for the title screen. The memory usage of the map is hard to determine but likely also saves some KB to MB there depending on the events
- Alter Aila Genesis: 297 -> 185
- Heros Realm: 297 -> 177
- Il mito: 120 -> 92
- Final Tear 3: 146 -> 93
- VH1: 101 -> 74
- TTHW: 88 -> 58
- DQ4: 66 -> 49
- Frozen Triggers: 60 -> 48
- 7thJojo: 54 -> 40
- Lakria Legends: 53 -> 40
- Sternenkindsaga: 40 -> 31
- Pokekon Eevee: 36 -> 32
- Wolfenhain: 29 -> 25
- Vampires Dawn II: 21 -> 20
- ゆめ2っきver0.113a: 24 -> 21
- DEEP 8 Demo: 26 -> 23
- Unterwegs in Düsterburg: 18 -> 17
- Yume Nikki: 15 -> 14,5
- Ib: 13,9 -> 13,8
Allows abstraction between different underlying string types
|
Some more numbers for reduced memory usage in MB on the title screen. The memory usage of the map is hard to determine but likely also saves some KB to MB there depending on the events
|
Depends on: EasyRPG/liblcf#379
See liblcf PR for details.